import Vue from 'vue'
import App from './App'
import config from './config.js'
import topCom from './pages/component/bottom.vue'
import bottomCom from './pages/component/topCom.vue'
import ImagePicker from "./components/image-picker/index.vue";

import api from './api'
import vue from 'vue'
/*  #ifdef  h5  */
import {
	createApp
} from 'vue';
/*  #endif  */
import qs from 'qs'
import {
	http
} from './api/httpIndex.js'
import axios from 'axios'
import * as imageConversion from 'image-conversion'
// const vanApp =vue.createApp();
// vanApp.use(Collapse);
// vanApp.use(CollapseItem);
// 请求axios数据

// axios.defaults.baseURL = 'https://www.zhxypt.net/hnsg/app/'
// axios.defaults.baseURL地址根api目录接口的基础地址保持一致 结尾没有app/
axios.defaults.baseURL = config.baseUrl;
//测试环境
// axios.defaults.baseURL = 'http://49.4.65.194:9092/app/'
// axios.defaults.baseURL = 'http://192.168.200.86:9091/app/' // 谭俊
// axios.defaults.baseURL = 'http://192.168.200.34:9091/app/' // 刘潇




var baseAppUrl = config.baseUrl+'app/'
//测试环境
// var baseAppUrl = 'http://49.4.65.194:9092/app/'

// var baseAppUrl = 'http://192.168.200.34:9091/app/'
// var baseAppUrl = 'http://localhost:9091/app/'
uni.url = baseAppUrl
Vue.prototype.$baseAppUrl = baseAppUrl
uni.$http = axios
Vue.prototype.$http = axios
Vue.prototype.$api = api
Vue.prototype.$qs = qs
Vue.config.productionTip = false
Vue.component('top-com', topCom)
Vue.component('bottom-com', bottomCom)
Vue.component('image-picker', ImagePicker)
const dt = new Date() //2525609975000
const y = dt.getFullYear() //1
const m = (dt.getMonth() + 1 + '').padStart(2, '0') //不足两位补0
const d = (dt.getDate() + '').padStart(2, '0')
const date = y + '-' + m + '-' + d
Vue.prototype.$date = date
App.mpType = 'app'

Date.prototype.format = function(fmt) {
	var o = {
		"M+" : this.getMonth()+1,                 //月份
		"d+" : this.getDate(),                    //日
		"h+" : this.getHours() % 12,                   //小时
		"H+" : this.getHours(),					  //小时
		"m+" : this.getMinutes(),                 //分
		"s+" : this.getSeconds(),                 //秒
		"q+" : Math.floor((this.getMonth()+3)/3), //季度
		"S"  : this.getMilliseconds()             //毫秒
	};
	if(/(y+)/.test(fmt)) {
		fmt=fmt.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length));
	}
	for(let k in o) {
		if(new RegExp("("+ k +")").test(fmt)){
			fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)));
		}
	}
	return fmt;
}



//在 main.js中引入使用
import mixin from "@/js/mixin.js"
Vue.use(mixin)


const app = new Vue({
	...App
})
app.$mount()
